from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.get('http://www.baidu.com')
# 获取元素的文本信息
getTxt = driver.find_element_by_css_selector('a[href="https://www.hao123.com?src=from_pc"]').text
print(getTxt)
# 获取value的属性值
button_attr = driver.find_element_by_id('su').get_attribute('value')
print(button_attr)
# 元素是否可见
button_element = driver.find_element_by_id('su')
print(button_element.is_displayed())
